import Vue from 'vue';

import Element from 'element-ui';
import './assets/styles/element-variables.scss';
import '@/assets/styles/index.scss'; // global css
import App from './App';
import store from './store';
import router from './router';
import plugins from './plugins'; // plugins
import './utils/drag-dialog.js';
import 'vxe-table/lib/style.css';

import './permission'; // permission control
import { resetForm } from '@/utils/jk/jk-tool';
import '@/styles/index.scss';
// 按需引入vxe-table
import './utils/jk/jk-vxe-table-import';
// 全局方法挂载
Vue.prototype.$resetForm = resetForm;
// 前往其他路由（不在左侧菜单显示的路由）
Vue.prototype.$toOtherRouter = function(e) {
	router.push({
		name: e.name,
		query: e.query,
		params: {
			...e.params,
			clearCache: 1
		}
	});
};
// 前往主路由（左侧菜单）
Vue.prototype.$toMainRouter = function(e) {
	router.push({
		name: e.name,
		query: e.query,
		params: {
			...e.params,
			clearCache: 1
		}
	});
};
import installGlobalComponent from './views/jk-components/install-component';
installGlobalComponent(Vue);

Vue.use(plugins);

import { tipsBar } from './utils/jk/jk-tool';

Vue.use(Element, {
  size: localStorage.getItem('size') || 'medium' // set element-ui default size
});
Vue.prototype.$tipsBar = tipsBar;

Vue.config.productionTip = false;

new Vue({
  el: '#app',
  router,
  store,
  render: h => h(App)
});
